package net.knightwatch.kwtools.database; 

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class BuildingTable {
	// Class Information
		private static final String TAG = "BuildingTable";
		// Database Table
		public static final String TABLE_BUILDING = "Buildings";
		public static final String COLUMN_ID = "_id"; // Building ID
		public static final String COLUMN_CUSTOMERID = "customerId"; // Customer ID		
		public static final String COLUMN_ADDRESSID = "addressId"; //Address ID
		public static final String COLUMN_NAME = "name"; // Building Name
		public static final String COLUMN_GPS_LONGITUDE = "gpsLatitude";
		public static final String COLUMN_GPS_LATITUDE = "gpsLongitude";
		public static final String COLUMN_GPS_ALTITUDE = "gpsAltitude";
		// Database Creation SQL Statement
		private static final String DATABASE_CREATE = "create table " 
				+ TABLE_BUILDING
				+ "("
				+ COLUMN_ID + " integer primary key autoincrement, "
				+ COLUMN_CUSTOMERID + " integer not null,"
				+ COLUMN_ADDRESSID + " integer not null,"
				+ COLUMN_NAME + " text not null,"
				+ COLUMN_GPS_LONGITUDE + " text not null,"
				+ COLUMN_GPS_LATITUDE + " text not null,"
				+ COLUMN_GPS_ALTITUDE + " text not null"
				+ ");";
		public static final String[] ALL_COLUMNS = {COLUMN_ID, COLUMN_CUSTOMERID, COLUMN_ADDRESSID, COLUMN_NAME, COLUMN_NAME, COLUMN_GPS_LONGITUDE, COLUMN_GPS_LATITUDE, COLUMN_GPS_ALTITUDE};
		
		
		public static void onCreate(SQLiteDatabase database) {
			Log.i(TAG, "Creating " + TABLE_BUILDING + " Table");
			try{
				database.execSQL(DATABASE_CREATE);
			} catch (Exception e){
				Log.v(TAG, e.toString());
			}
		}
		public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
			
		}
}
